package com.cloud.lan.entity.enums;

/**
 * 兑换码活动状态
 * @author ErKang
 * @date Created in 2022/1/20 00:39
 * @title LanActivityStatusEnums.java
 * Department: Product development
 */
public enum LanActivityStatusEnums {

    // 1:已上架(进行中) 2:已下架 3:已失效
    ONE(1, "已上架(进行中)"),
    TOW(2, "已下架"),
    THREE(3, "已失效"),
    ;

    private Integer id;
    private String name;

    LanActivityStatusEnums(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static String getById(final Integer id) {
        for (LanActivityStatusEnums type : LanActivityStatusEnums.values()) {
            if (type.getId().equals(id)) {
                return type.getName();
            }
        }
        return "Code not found, the code is " + id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
